package com.sright.bcard.user.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.user.dal.dao.MemberDAO;
import com.sright.bcard.user.dal.entity.MemberDO;
import com.sright.bcard.user.dal.mapper.MemberDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class MemberDAOImpl extends BaseDAOImpl<MemberDO> implements MemberDAO {

    @Resource
    private MemberDOMapper memberDOMapper;

    @Override
    protected BaseMapper<MemberDO> getObjMapper() {
        return memberDOMapper;
    }

    @Override
    public MemberDO selectMemberIdByNickName(String nickName) {
        return memberDOMapper.selectMemberByNickName(nickName);
    }

    @Override
    public MemberDO selectByOpenId(String openId) {
        return memberDOMapper.selectByOpenId(openId);
    }

    @Override
    public List<MemberDO> selectAll() {
        return memberDOMapper.selectAll();
    }

    @Override
    public Integer countAvatar(Integer needReview) {
        return memberDOMapper.countAvatar(needReview);
    }

    @Override
    public List<MemberDO> avatarList(PageParamRequest paramRequest, Integer needReview) {
        return memberDOMapper.avatarList(paramRequest,needReview);
    }
}
